package io.github.yotta.logger.api.feign;

import io.github.yotta.common.api.model.Response;
import io.github.yotta.logger.api.iface.LogApi;
import io.github.yotta.logger.api.request.LogCreateRequest;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import static io.github.yotta.logger.api.properties.LogApiProperties.SERVICE_NAME;

/**
 * @author yotta
 * @date 2023/3/30 8:34
 * 配置提供这个feign接口实现的服务
 */
@FeignClient(name = "${"+SERVICE_NAME+"}", path = "/log/admin",contextId = "logFeignApi")
public interface LogFeignApi extends LogApi {

    @Override
    @PostMapping("/save")
    Response<Long> save(@RequestBody LogCreateRequest request);
}
